package main

import (
	"fmt"
	"net/http"
	"sync"
)

//协成等待结束
func main() {
	var wg sync.WaitGroup
	for i := 0; i < 100; i++ {
		fmt.Println(i, "\n")
		wg.Add(1)
		go func() {
			resp, _ := http.Get("http://www.baidu.com")
			defer resp.Body.Close()
			wg.Done()
		}()
	}
	wg.Wait()
}
